package net.stogi.common.gwt.dispatch.server.core;

import net.stogi.common.gwt.dispatch.shared.core.Action;
import net.stogi.common.gwt.dispatch.shared.core.Result;

/**
 * This is a subclass of {@link ActionHandlerRegistry} which allows registration
 * of handlers by passing in the handler instance directly.
 */
public interface InstanceActionHandlerRegistry<A extends Action<R>, R extends Result> extends
		ActionHandlerRegistry<A, R> {

	/**
	 * Adds the specified handler instance to the registry.
	 * 
	 * @param handler
	 *            The action handler.
	 */
	void addHandler(ActionHandler<A, R> handler);

	/**
	 * Removes the specified handler.
	 * 
	 * @param handler
	 *            The handler.
	 * @return <code>true</code> if the handler was previously registered and
	 *         was successfully removed.
	 */
	boolean removeHandler(ActionHandler<A, R> handler);
}
